ETH2.0: Light client
code: update_memory.py
def update_memory(memory: LightClientMemory, update: LightClientUpdate) -> None:
# Verify the update does not skip a period
# (Omitted)
assert next_period in (current_period, current_period + 1)
# Verify update header against shard block root and header branch
assert is_valid_merkle_branch(
# (Omitted)
)
# Verify persistent committee votes pass 2/3 threshold
# (Omitted)
assert 3 * sum(filter(lambda i: update.aggregation_bitsi, balances)) > 2 * sum(balances) # Verify shard attestations
# (Omitted)
assert bls.FastAggregateVerify(pubkeys, signing_root, update.signature)
# Update period committees if entering a new period
# (Omitted)
# Update header
memory.header = update.header
Eth 2.0 Light Clients: How Light is Light? by Cayman Nava (ChainSafe)
https://www.youtube.com/watch?v=IWecr0FFH0c
Discussions, pervious proposals